package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserInfoMapper extends BaseMapper<UserInfo> {


    @Select("SELECT i.* FROM tb_black_list l INNER JOIN tb_user_info i \n" +
            "ON l.`black_user_id` = i.`id` WHERE l.`user_id`=#{userId}")
    Page<UserInfo> findBlackList(Page<UserInfo> page,@Param("userId") Long userId);

    @Select("select * from tb_user_info where id=#{friendId}")
    UserInfo findById(Long friendId);

    @Update("update tb_user_info set user_status=#{status} where id=#{userId}")
    void updateUserStatusById(@Param("userId") Long userId,@Param("status")String status);
}
